package com.ruoyi.auth;

import com.tdd.wx.users.api.IWxUserService;
import com.tdd.wx.users.entity.WxUser;
import com.tdd.wx.users.mongo.WxUserHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @author lobyliang
 */
@Component
@Slf4j
public class TestRunner implements ApplicationRunner{
//    @Autowired
//    IWxUserService service;
//@Autowired
//WxUserHandler wxUserHandler;
    @Override
    public void run(ApplicationArguments args) throws Exception{
//        WxUser byUnionId = wxUserHandler.findByUnionId("o7L7I52gYIU6rVNEckQ6sUxr8QEM");
//        log.debug("{}",byUnionId);
        //        WxUser byUnionId = service.findByUnionId("o7L7I56TtGDpp_rdwo-ikFyGSXsg");
//        log.info(byUnionId.toString());
       /* WxUser user = new WxUser();
        service.delByOpenId("o3oFR5OJuV1zjqhKV3IVwtAv1afY");
        user.setOpenId("o3oFR5OJuV1zjqhKV3IVwtAv1afY");
        user.setNickName("A大猫");
        user.setPhone("18827279647");
        user.setUserLevel(1);
        user.setUnionId("o7L7I54iOpWKg4PXHdfOyhEVAH50");
        user.setAvatar("https://thirdwx.qlogo.cn/mmopen/vi_32/gPc7PuicV8gkWPicpQ5Ah9kzcy2cB4aHPxsTPiaoXYNu8JX45nptZ3m3zsLicLElFv4BbeSnNGQTduv80g9L7yBCrA/132");
        service.save(user);
        user = null;
        user = service.findByUnionId("o7L7I54iOpWKg4PXHdfOyhEVAH50");
        log.info(user.toString());*/
    }
}
